package com.iotechn.unimall.admin.api.seed;
import com.iotechn.unimall.core.Const;
import com.iotechn.unimall.core.annotation.HttpMethod;
import com.iotechn.unimall.core.annotation.HttpOpenApi;
import com.iotechn.unimall.core.annotation.HttpParam;
import com.iotechn.unimall.core.annotation.HttpParamType;
import com.iotechn.unimall.core.annotation.param.NotNull;
import com.iotechn.unimall.core.exception.ServiceException;
import com.iotechn.unimall.data.domain.SeedDO;
import com.iotechn.unimall.data.model.Page;

import java.util.List;
import java.util.Map;

/**
 * 种子
 *
 * @author hct
 * @email 77802226@qq.com
 * @date 2020-07-20 14:21:25
 */
@HttpOpenApi(group = "admin.seed", description = "")
public interface AdminSeedService {

    @HttpMethod(description = "列表", permission = "list", permissionParentName = "一分田", permissionName = "种子管理")
    Page<SeedDO> list(
            @HttpParam(name = "pageNo", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页长度", valueDef = "20") Integer limit,
            @HttpParam(name = "name", type = HttpParamType.COMMON, description = "名称") String name,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "创建", permission = "generator:seed:create", permissionParentName = "一分田", permissionName = "种子管理")
    SeedDO create(
            @NotNull @HttpParam(name = "seedDO", type = HttpParamType.COMMON, description = "") SeedDO seedDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "修改", permission = "generator:seed:update", permissionParentName = "一分田", permissionName = "种子管理")
    String update(
            @NotNull @HttpParam(name = "seedDO", type = HttpParamType.COMMON, description = "") SeedDO seedDO,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "删除", permission = "generator:seed:delete", permissionParentName = "一分田", permissionName = "种子管理")
    String delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "删除Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "详情", permission = "generator:seed:detail", permissionParentName = "一分田", permissionName = "种子管理")
    SeedDO detail(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "Id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "批量删除", permission = "operation:seed:batchdelete", permissionParentName = "一分田", permissionName = "种子管理")
    String batchDelete(
            @NotNull @HttpParam(name = "ids", type = HttpParamType.COMMON, description = "新闻Id") String ids,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员Id") Long adminId) throws ServiceException;


    @HttpMethod(description = "展示列表", permission = "operation:seed:batchdelete", permissionParentName = "一分田", permissionName = "种子管理")
    List<SeedDO> select() throws ServiceException;

}

